<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/jq.mselect.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.mselect.js?"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.multiselect.js"></script>
<script type="text/javascript">
$(function(){
	$(".datepicker").datepicker({dateFormat:'yy-mm-dd',changeMonth:true});
	$("#multiselect").multiselect({height: 260, minWidth: 160});
});
</script>
<fieldset><legend>查询条件</legend>
<form method="get">
<? include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tr>
	<th>销售日期：</th>
	<td>
		<input type="text" class="datepicker" name="begin" value="<?=isset($_GET['begin'])?$_GET['begin']:date('Y-m-01', strtotime(date('Y-m-d',CURRENT_TIMESTAMP).' -1 month'))?>" /> to 
		<input type="text" class="datepicker" name="end" value="<?=isset($_GET['end'])?$_GET['end']:date('Y-m-t', strtotime(date('Y-m-d',CURRENT_TIMESTAMP).' -1 month'))?>" />
	</td>
</tr>
<tr>
	<th>网站/店铺</th>
	<td>
		<select name="shop_id[]" multiple="multiple" id="multiselect">
		<?foreach ($shop_group as $k => $sg):?>
		<optgroup label="<?=$k?>">
		<?foreach ($sg as $s):?>
		<option value="<?=$s['id']?>" <?if (isset($_GET['shop_id']) && is_array($_GET['shop_id']) && in_array($s['id'], $_GET['shop_id'])) echo "selected='selected'"?>><?=$s['name']?></option>
		<?endforeach;?>
		</optgroup>
		<?endforeach;?>
		</select>
	</td>
</tr>
<tr>
	<td><input type="hidden" name="is_search" value="1" /></td>
	<td><input type="submit" class="button" value="查询" /></td>
</tr>
</table>
</form></fieldset>
<?if (isset($file_name)):?><a href="<?=$file_name?>">右键另存为</a><?endif;?>
<?php $this->_endblock();?>